﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucListEmailOrder.ascx.cs"
    Inherits="Admin_UserControl_ucListEmail" %>
<asp:DataList ID="DataList1" runat="server" OnItemCommand="DataList1_ItemCommand"
    OnItemDataBound="DataList1_ItemDataBound" RepeatDirection="Horizontal">
    <SeparatorTemplate>
        | &nbsp;
    </SeparatorTemplate>
    <ItemTemplate>
        <asp:LinkButton ID="lnkbtnPaging" runat="server" CommandArgument='<%# Bind("PageIndex") %>'
            Text='<%# Bind("PageText") %>'></asp:LinkButton>
    </ItemTemplate>
</asp:DataList>
<br />

<script type="text/javascript">
    function s() {
        var t = document.getElementById("<%=grdListEmail.ClientID%>");
        var t2 = t.cloneNode(true)
        for (i = t2.rows.length - 1; i > 0; i--)
            t2.deleteRow(i)
        t.deleteRow(0)
        a.appendChild(t2)
    }
    window.onload = s
</script>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <div id="a">
            </div>
            <div style="overflow-y: scroll; height: 360px">
                <asp:GridView ID="grdListEmail" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                    EmptyDataText="Not Found Email" AllowSorting="True" CssClass="yui" Width="100%"
                    OnPageIndexChanging="grdListEmail_PageIndexChanging" OnSorting="grdListEmail_Sorting"
                    OnRowDataBound="grdListEmail_RowDataBound">
                    <Columns>
                        <%--<asp:BoundField DataField="status" HeaderText="Status" SortExpression="status" />--%>
                        <asp:BoundField DataField="IDEmail" HeaderText="E-ID" SortExpression="IDEmail" >
                            <HeaderStyle HorizontalAlign="Center" ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Customer">
                            <ItemTemplate>
                                <asp:HyperLink ID="hypName" runat="server"></asp:HyperLink>
                            </ItemTemplate>
                            <HeaderStyle Width="13%" HorizontalAlign="Left" ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" Width="13%" />
                        </asp:TemplateField>
                        <asp:HyperLinkField DataTextField="EmailAddress" HeaderText="Email Address" 
                            SortExpression="EmailAddress" >
                            <HeaderStyle Width="15%" HorizontalAlign="Center" ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" Width="15%" />
                        </asp:HyperLinkField>
                        <asp:BoundField DataField="DateBook" HeaderText="Date Book" SortExpression="Price"
                            DataFormatString="{0:dd/MM/yyyy}" >
                           <HeaderStyle Width="10%" HorizontalAlign="Center" ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" Width="15%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DateBook" HeaderText="Time" 
                            SortExpression="DateBook" >
                            <HeaderStyle HorizontalAlign="Center" Width="10%" ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Notes">
                            <ItemTemplate>
                                <asp:HiddenField ID="hidField" runat="server" />
                                <asp:TextBox ID="txtNotes" TextMode="MultiLine" Width="84%" Height="20px" runat="server"></asp:TextBox>
                                <asp:CheckBox ID="ckEnable" runat="server" OnCheckedChanged="ckEnable_CheckedChanged"
                                    AutoPostBack="true" />
                                <asp:ImageButton ID="btnSave" runat="server" ToolTip="Save" CommandName="Delete"
                                    OnClick="btnSave_Click" CommandArgument='<%# Eval("IDEmail") %>' ImageUrl="~/Admin/img/ic-save.png" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="65%" />
                            <HeaderStyle Width="65%" HorizontalAlign="Center" ForeColor="White" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Confirm">
                            <ItemTemplate>
                                <asp:ImageButton ID="btnConfirm" runat="server" ToolTip="Confirm Email" CommandName="Confirm"
                                    OnClick="btnConfirm_Click" CommandArgument='<%# Eval("IDEmail") %>' ImageUrl="~/Admin/img/confirm1.gif" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" ForeColor="White" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle CssClass="clsGrdHeader" />
                    <RowStyle CssClass="clsGrdRow" />
                    <AlternatingRowStyle CssClass="clsGrdAlternateRow" />
                    <PagerStyle CssClass="clsPage" />
                </asp:GridView>
            </div>
        </td>
    </tr>
</table>
